/*
 * GameLogicServer.h
 *
 *  Created on: Jan 8, 2014
 *      Author: root
 */

#ifndef GAMELOGICSERVER_H_
#define GAMELOGICSERVER_H_
#include <pthread.h>
#include <errno.h>
#include <string.h>
#include <semaphore.h>
#include <iostream>
#include <vector>

#include "../gameLogicServer/GameLogicServer.h"
#include "../common/ClientClass.h"
#include "../data/ThreadSafeDataManager.h"

#define WORK_THREAD_NUM 10
using namespace std;
namespace miniGameServer {

class GameLogicServer {
public:
	GameLogicServer();
	virtual ~GameLogicServer();

	void startServer();
	void stopServer();
	/*
	 * 工作flag。0表示停止，1表示运行。
	 */
	int workFlag;
	pthread_t threadids[WORK_THREAD_NUM];
	pthread_t threadid;
private:
	static void* startThread(void* argv);
	void work();

	void doSomeThing(ClientClass *client);
};

}

#endif /* GAMELOGICSERVER_H_ */
